package hbm;

import java.math.BigDecimal;

/**
 * AbstractInventarioId entity provides the base persistence definition of the
 * InventarioId entity. @author MyEclipse Persistence Tools
 */

public abstract class AbstractInventarioId implements java.io.Serializable {

	// Fields

	private BigDecimal cantidad;
	private Mercaderia mercaderia;
	private Sucursal sucursal;

	// Constructors

	/** default constructor */
	public AbstractInventarioId() {
	}

	/** minimal constructor */
	public AbstractInventarioId(Mercaderia mercaderia, Sucursal sucursal) {
		this.mercaderia = mercaderia;
		this.sucursal = sucursal;
	}

	/** full constructor */
	public AbstractInventarioId(BigDecimal cantidad, Mercaderia mercaderia,
			Sucursal sucursal) {
		this.cantidad = cantidad;
		this.mercaderia = mercaderia;
		this.sucursal = sucursal;
	}

	// Property accessors

	public BigDecimal getCantidad() {
		return this.cantidad;
	}

	public void setCantidad(BigDecimal cantidad) {
		this.cantidad = cantidad;
	}

	public Mercaderia getMercaderia() {
		return this.mercaderia;
	}

	public void setMercaderia(Mercaderia mercaderia) {
		this.mercaderia = mercaderia;
	}

	public Sucursal getSucursal() {
		return this.sucursal;
	}

	public void setSucursal(Sucursal sucursal) {
		this.sucursal = sucursal;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof AbstractInventarioId))
			return false;
		AbstractInventarioId castOther = (AbstractInventarioId) other;

		return ((this.getCantidad() == castOther.getCantidad()) || (this
				.getCantidad() != null
				&& castOther.getCantidad() != null && this.getCantidad()
				.equals(castOther.getCantidad())))
				&& ((this.getMercaderia() == castOther.getMercaderia()) || (this
						.getMercaderia() != null
						&& castOther.getMercaderia() != null && this
						.getMercaderia().equals(castOther.getMercaderia())))
				&& ((this.getSucursal() == castOther.getSucursal()) || (this
						.getSucursal() != null
						&& castOther.getSucursal() != null && this
						.getSucursal().equals(castOther.getSucursal())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getCantidad() == null ? 0 : this.getCantidad().hashCode());
		result = 37
				* result
				+ (getMercaderia() == null ? 0 : this.getMercaderia()
						.hashCode());
		result = 37 * result
				+ (getSucursal() == null ? 0 : this.getSucursal().hashCode());
		return result;
	}

}